package com.szjz.rabbitmq.springboot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author 史博
 * @desc
 * @date 2020/8/25 6:06 下午 周二
 */
@Slf4j
@Component
// 声明队列并设置队列名
@RabbitListener(queuesToDeclare = @Queue("hello") )
public class HelloConsumer {

    @RabbitHandler
    public void receiveMassage(String massage){
        log.info("==== massage: {}",massage);
    }
}
